.box{
  width: 50px;
  height: 50px;
  background: #0055ee;
  animation: test 3s infinite alternate;
  position: absolute;
  top: 0;
  left: 0;
}

@keyframes test {
  0%{
    top: 0;
    left: 0;
  }
  25%{
    top: 0;
    left: 300px;
  }
  50%{
    top: 300px;
    left: 300px;
  }
  75%{
    top: 300px;
    left: 0px;
  }
  100%{
    top: 0;
    left: 0;
  }
}
